﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>文件上传控件（FLASH）</title>
    

    <script src="../../scripts/boot.js" type="text/javascript"></script>

    <script src="swfupload/swfupload.js" type="text/javascript"></script>
    <link href="../../scripts/miniui/themes/blue/skin.css" rel="stylesheet" type="text/css" />
</head>
<body>
<input id="fileupload1" class="mini-fileupload" name="Fdata" limitType="*.txt" 
    flashUrl="swfupload/swfupload.swf"
    uploadUrl="upload.jsp"
    onuploadsuccess="onUploadSuccess" 
    onuploaderror="onUploadError" onfileselect="onFileSelect"
    />
     <br />
     <input type="button" value="上传" onclick="startUpload()"/>
    <div class="description">
        <h3>Description</h3>
        <p>FileUpload文件上传控件，基于FLASH的swfupload实现，能实现无刷新上传文件功能。</p>
    </div>
</body>
</html>
<script type="text/javascript">
    mini.parse();

    //动态设置url
//    var fileupload = mini.get("fileupload1");
//    fileupload.setUploadUrl("upload.jsp");

    function onFileSelect(e) {
        //alert("选择文件");
    }
    function onUploadSuccess(e) {

        alert("上传成功：" + e.serverData);

        this.setText("");
    }
    function onUploadError(e) {
        
    }

    function startUpload() {
        var fileupload = mini.get("fileupload1");

        fileupload.startUpload();
    }


</script>